/*
 * Copyright and license 
 */
package gui;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.JFrame;

/**
 * @author JuanK
 *
 */
public class FullScreenDialog extends JFrame implements KeyListener{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private MainFrame parent;
	

	public FullScreenDialog(MainFrame parent)
	{
		this.parent = parent;
		this.setContentPane(parent.getContentPane());
		this.addKeyListener(this);
		init();
	}
	
	private void init()
	{
		this.setExtendedState(MAXIMIZED_BOTH);
		this.setUndecorated(true);
	}

	/* (non-Javadoc)
	 * @see java.awt.event.KeyListener#keyPressed(java.awt.event.KeyEvent)
	 */
	@Override
	public void keyPressed(KeyEvent e) {
		switch(e.getKeyCode())
		{
		case KeyEvent.VK_F1:
			FrameTreatmentOptions treatmentFrame = new FrameTreatmentOptions(parent);
			treatmentFrame.setVisible(true);
			break;
		case KeyEvent.VK_ESCAPE:
			parent.setContentPane(this.getContentPane());
			this.dispose();
			break;
		}
		
	}

	/* (non-Javadoc)
	 * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
	 */
	@Override
	public void keyReleased(KeyEvent e) {

		
	}

	/* (non-Javadoc)
	 * @see java.awt.event.KeyListener#keyTyped(java.awt.event.KeyEvent)
	 */
	@Override
	public void keyTyped(KeyEvent e) {
		

	}
}
